package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by csuarez on 07/02/14.
 */
public class User {
    private String name;
    private String mail;
    private String phone;
    private String userID;
    private String password;
    private List<Borrowable> borrowables;


    public User(String name, String mail, String phone, String userID, String password) {
        this.name = name;
        this.mail = mail;
        this.phone = phone;
        this.userID = userID;
        this.password = password;
        this.borrowables = new ArrayList<Borrowable>();
    }

    public String getInformation() {
        return name + ", " + mail + ", " + phone;
    }

    public boolean isValid(String userID, String password) {
        return(userID.equals(this.userID) && password.equals(this.password));
    }

    public void addToCheckedOut(Borrowable borrowable) {
        borrowables.add(borrowable);
    }

    public List<Borrowable> getCheckedOutBorrowables() {
        return borrowables;
    }

    public void removeFromCheckedOut(Borrowable borrowable) {
        borrowables.remove(borrowable);
    }
}